Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

db,pm: avoid redeeming expired tickets #1598

Merged
merged 2 commits into from
Oct 21, 2020

Conversation

kyriediculous
Copy link
Contributor

@kyriediculous kyriediculous commented Aug 2, 2020

What does this pull request do? Explain your changes. (required)
This PR avoids the redemption of expired winning tickets.

Specific updates (required)

  • Change signatures of SelectEarliestWinningTicket and WinningTicketCount to take in a minCreationRound parameter. The creationRound for tickets stored would have to be greater or equal to this value to be considered a non-expired ticket (the expiry is two rounds)
  • Adjust the respective SQL queries
  • Check whether a ticket is already redeemed before trying to redeem a ticket, mark it as redeemed if that's the case 7b3a95c

How did you test each of these updates (required)
Added unit tests , cherry picked this onto the Livepool orchestrator and observe my stale ticket is no longer being retried endlessly.

Does this pull request close any open issues?
Fixes #1594
Fixes #632

Checklist:

  • README and other documentation updated
  • Node runs in OSX and devenv
  • All tests in ./test.sh pass

@kyriediculous
Copy link
Contributor Author

@jailuthra I just tagged you in case you might be interested in these areas of the codebase, please don't feel obligated to review this !

Copy link
Member

@yondonfu yondonfu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good just one small comment.

pm/queue.go Outdated Show resolved Hide resolved
Copy link
Member

@yondonfu yondonfu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM after squashing fixup commits

@kyriediculous kyriediculous force-pushed the nv/avoid-redeem-expired-tix branch from f0ed105 to a46f215 Compare October 21, 2020 16:12
@kyriediculous kyriediculous merged commit 5b0ca24 into master Oct 21, 2020
@kyriediculous kyriediculous deleted the nv/avoid-redeem-expired-tix branch October 21, 2020 21:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

pm: recipient redeems old valid winning tickets on start up Orchestrator tries to redeem expired tickets
2 participants